<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" import="java.util.List,com.van.pojo.Product,com.van.pojo.Tag"%>
<%List products = (List)request.getAttribute("products");
List tags = (List)request.getSession().getAttribute("tags");%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>轻课商城</title>
	<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
	<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container">
    <form role="form" action="productOperation" method="post" accept-charset="utf-8">
    <input type="hidden" name="type" value="new"/>
    <div class="form-group">
    		<label for="name">名称</label>
		    <input type="text" class="form-control" name="title" placeholder="请输入名称">
	</div>
	<div class="form-group">
    		<label for="code">编码</label>
		    <input type="text" class="form-control" name="code" placeholder="请输入编码">
	</div>
	<div class="form-group">
    		<label class="control-label">分类</label>
		    <select class="form-control input-sm" name="tag_id">
					    <% for(Object tg : tags) {
					    	Tag tag = (Tag)tg;
					    %>
					      <option value=<%=tag.getId()%>><%=tag.getName()%></option>
					    <% }%>
			</select>
	</div>
     <div class="form-group">
    		<label for="note">描述</label>
		    <textarea class="form-control" name="note" placeholder="请输入描述" rows="3"></textarea>
	</div> 
	<div class="form-group">
    		<label for="price">价格</label>
		    <input type="number" class="form-control" name="price" placeholder="请输入价格">
	</div>
	<div class="form-group">
    		<label for="totalNumber">库存</label>
		    <input type="number" class="form-control" name="totalNumber" placeholder="请输入库存">
	</div>
	<input type="submit" class="btn btn-default" ></button>
	</form>
    </div> 
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  </body>
</html>